﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
#if !DOT_NET
using Windows.Foundation;

#endif

namespace StyleMVVM.Logging
{
	/// <summary>
	/// This interface can be implemented and exported by a class that wants to participate in the logging subsystem as a consumer of log entries
	/// </summary>
	public interface ILogAppender
	{
		/// <summary>
		/// Configure is called at application startup time
		/// </summary>
		/// <returns></returns>
#if NETFX_CORE
		IAsyncOperation<bool> Configure();
#else
		Task<bool> Configure();
#endif

		/// <summary>
		/// Flush is called when the logging service is being forced to flush. The intention is that you flush any message buffers you have.
		/// </summary>
		void Flush();

		/// <summary>
		/// The general log level the log service is set at.
		/// </summary>
		LogLevel LoggingLevel { get; set; }

		/// <summary>
		/// Log method called when a log statement is recorded to the logging service. 
		/// This method must be quick as it is run on which ever thread is calling log
		/// </summary>
		/// <param name="entry"></param>
		void Log(LogEntry entry);
	}
}